import {ElMessage, ElMessageBox} from "element-plus";

export function confirm(message: string, onConfirm: () => void, title?: string) {
  ElMessageBox.confirm(message, title || '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: "warning",
  }).then(() => {
    onConfirm();
  })
}

export function alertSuccess(message: string) {
  ElMessage.success(message)
}

export function alertError(message: string) {
  ElMessage.error(message)
}

export function alertInfo(message: string) {
  ElMessage.info(message)
}
